<!--<h2>{{hero.name | uppercase}} Details</h2>-->
<!--<div><span>id: </span>{{hero.id}}</div>-->
<!--<div>-->
<!--  <label for="name">Hero name: </label>-->
<!--  <input id="name" [(ngModel)]="hero.name" placeholder="name">-->
<!--</div>-->

<h2>My Heroes</h2>

<div>
  <label for="new-hero">Hero name: </label>
  <input id="new-hero" #heroName />

  <!-- (click) passes input value to add() and then clears the input -->
  <button class="add-button" (click)="add(heroName.value); heroName.value=''">
    Add hero
  </button>
</div>

<ul class="heroes">
  <li *ngFor="let hero of heroes">
    <a routerLink="/detail/{{hero.id}}">
      <span class="badge">{{hero.id}}</span> {{hero.name}}
    </a>
    <button class="delete" title="delete hero"
            (click)="delete(hero)">x</button>
  </li>
</ul>

<!--<div *ngIf="selectedHero">

  <h2>{{selectedHero.name | uppercase}} Details</h2>
  <div><span>id: </span>{{selectedHero.id}}</div>
  <div>
    <label for="hero-name">Hero name: </label>
    <input id="hero-name" [(ngModel)]="selectedHero.name" placeholder="name">
  </div>

</div>-->

<!--<app-hero-detail [hero]="selectedHero"></app-hero-detail>-->
